package com.common.utils
{
	import flash.display.DisplayObject;
	import flash.events.KeyboardEvent;
	import flash.ui.Keyboard;

	/**
	 * 各种事件的管理 如键盘，鼠标
	 * @author LiangXuhu
	 * 
	 */	
	public class EventManager
	{
		public function EventManager()
		{
		}
		/**
		 * 
		 * @param sourceComp
		 * @param listenFunc
		 * 
		 */		
		public static function addKeyboardEventListener(sourceComp :DisplayObject,
														listenFunc:Function):void
		{
			sourceComp.addEventListener(KeyboardEvent.KEY_DOWN,inerFunc);
			function inerFunc(e:KeyboardEvent):void
			{
				switch(e.keyCode)
				{
					case Keyboard.ENTER:
					{
						listenFunc.call();
						break;
					}
				}
			}
		}
	}
}